<script lang="ts">
  import type { DatasetEntry } from "@store/entity/dataset/entry";
  import el from "date-fns/locale/el";
  export let entry: DatasetEntry;
  $: entryName = entry?.name || "";
  $: suffix = entry?.suffix || "";
  $: repo_url =  entry?.repo_url || "";
</script>
<div class="flex-container items-start w-full flex-col h-full">
  <div class="flex-container justify-start flex-row text-2xl grow-0 break-words break-all" >
    {entryName}
  </div>
  <div class="justify-start italic w-full grow flex-none text-sm pt-2 text-center">
    {#if ["jpg", "jpeg", "png", "gif"].includes(suffix)}
      <!-- svelte-ignore a11y-missing-attribute -->
      <img src={repo_url} />
    {:else if ["txt", ].includes(suffix)}
      <embed src={repo_url} >
    {:else}
        文件没有提供预览
    {/if}
  </div>
</div>